/**
 * 
 */
package com.network.topo.dao;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import com.network.topo.CommonBean;
import com.network.topo.TopoDiscoverMain;
import com.network.topo.dbobj.FireWallObj;
import com.network.topo.dbobj.IpMacTable;
import com.network.topo.dbobj.LinkObj;
import com.network.topo.dbobj.NodeObj;
import com.network.topo.dbobj.PcServer;
import com.network.topo.dbobj.PortObj;
import com.network.topo.dbobj.ProbeObj;
import com.network.topo.dbobj.PwDeviceObj;
import com.network.topo.dbobj.SubNetObj;
import com.network.topo.dbobj.VirHostObj;
import com.network.topo.dbobj.VoipServer;
import com.network.topo.maindiscover.TopoTask;
import com.network.topo.node.AbstractNode;
import com.network.topo.node.Router;
import com.network.topo.schedule.TaskInfo;
import com.network.util.jdbc.CommonDBO;

/**
 * @author Administrator
 * 
 */
public interface TopoDaoInterface
{
	

	public boolean checkHostIpFromDB(AbstractNode node, String tempIP);

	public String getDbSysdate();
	public void deletePreTaskDetail(String taskId);

	public void specialDeal();

	public void addTaskLog(String taskId, String startTimeStr, String operator, int addNum, int updateNum, int deleteNum,String unknown,String notdiscover);
	public void updateTaskLog(String taskId, int addNum, int updateNum, int deleteNum,String unknown,String notdiscover);

	public String getTopoUpdateInfoSql(Object objss[]);

	public String getElementUpdateInfoSql(int update_type, Timestamp update_time, String element_ip);

	public void getObjInDB(String tableName, LinkedList<String> ObjInDB, LinkedList<String> allIpList) throws TopoDaoException;

	public void getUnknownDeviceInDB(LinkedList<String> ObjInDB, LinkedList<String> taskAllIpList) throws TopoDaoException;

	public void getSubnetInDB(LinkedList<String> ObjInDB, LinkedList<String> taskAllIpList) throws TopoDaoException;

	public void getLinkInDB(LinkedList<String> ObjInDB, LinkedList<String> taskAllIpList) throws TopoDaoException;
	
	public LinkedList<LinkObj> getAllLinkInDB( LinkedList<String> taskAllIpList);

	public String getPrentLink(String ip ) throws TopoDaoException;
	
	public LinkedList<String> getAllSwitch() throws TopoDaoException;
	
	public PortObj getPortObj(String id ) throws TopoDaoException;
	
	public PortObj getPortObj(String ipAddr, String index ) throws TopoDaoException;
	
	public int getMaxID() throws TopoDaoException;

	public boolean existInLinkTable(String mac);

	public int saveVirHost1(VirHostObj virHost, CommonBean commonBean, TaskInfo task, Timestamp now);

	public int saveVirHost2(VirHostObj virHost, CommonBean commonBean, TaskInfo task, Timestamp now);

	public void saveVirHost3(VirHostObj virHost);

	public int saveVirHost4(VirHostObj virHost, CommonBean commonBean, TaskInfo task, Timestamp now);

	public int saveVirHost5(VirHostObj virHost, CommonBean commonBean, TaskInfo task, Timestamp now);

	public void deleteLink(LinkObj link);

	public Vector<String> selectID();

	public void saveDiscoverDetail(String detail, String taskId);

	public String getMarkIpInDB(String deviceIP);
	
	public LinkedList<String > getSameDiever(String element_id);

	public String getSysVendor(String oid);

	public String getDeviceType(String oid);

	public String getDeviceDetailType(String oid);

	public String getVendorID(String vendor);

	public String getRouterMarkIpInDB(String routerIP);

	public void saveIp2Mac(Router router);

	public String findRouter(String switchip);

	public void saveLink(LinkedList<Object[]> saveData);

	public String insertSQL_conf_unix_server(Object[] rowData, Timestamp now);

	public String updateSQL_conf_ne_probe(ProbeObj element, Timestamp now);

	public String insertSQL_conf_ne_probe(Object[] rowData, Timestamp now);

	public String insertSql_conf_sec_firewall(Object[] rowData, Timestamp now);

	public String updateSql_conf_sec_firewall(FireWallObj element, Timestamp now);

	public String updateSql_conf_sec_pwdevice(PwDeviceObj element, Timestamp now);

	public String insertSql_conf_sec_pwdevice(Object[] rowData, Timestamp now);

	public String updateSql_conf_ne(NodeObj element, Timestamp now, TaskInfo task);

	public String insertSql_conf_ne(Object[] rowData, Timestamp now);

	public String updateSql_conf_voip_vogateway(VoipServer element, Timestamp now);

	public String insertSql_conf_voip_vogateway(Object[] rowData, Timestamp now);

	public String updateSql_conf_pc_server(PcServer element, Timestamp now, TaskInfo task);

	public String insertSql_conf_pc_server(Object[] rowData, Timestamp now);

	public String updateSql_conf_unix_server(PcServer element, Timestamp now, TaskInfo task);

	public int saveVoip1(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, VoipServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveVoip2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, VoipServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveVoip3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, VoipServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveVoip4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, VoipServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public void saveHost1(LinkedList<String> hostInDB, AbstractNode node);

	public int saveHost2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveHost3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveHost4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveHost5(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public void saveHost_Unix1(AbstractNode node, LinkedList<String> hostInDB);

	public int saveHost_Unix2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveHost_Unix3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveHost_Unix4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveHost_Unix5(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PcServer element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public void saveProbe1(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, ProbeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveProbe2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, ProbeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveProbe3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, ProbeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveProbe4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, ProbeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFireWall1(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, FireWallObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFireWall2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, FireWallObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFireWall3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, FireWallObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFireWall4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, FireWallObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int savePwDevice1(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PwDeviceObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int savePwDevice2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PwDeviceObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int savePwDevice3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PwDeviceObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int savePwDevice4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, PwDeviceObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public boolean checkNodeExist(AbstractNode node);
	public boolean checkNetWorkNode(AbstractNode node);

	
	public int saveNode2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveNode3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveNode4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveNode5(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFibresw1(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFibresw2(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFibresw3(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public int saveFibresw4(boolean portChange, boolean ipAddrChange, LinkedList<String> portSql, LinkedList<String> ipAddrSql, NodeObj element, Timestamp now, TaskInfo task, CommonBean commonBean);

	public void saveSubnet(LinkedList<SubNetObj> subNetObjList, TaskInfo task);

	public int dealNotFoundVirHost(LinkedList<String> virHostListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean);

	public int dealNotFoundVoip(LinkedList<String> voipListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean, LinkedList<String> updateSqlList);

	public int dealNotFoundHost(LinkedList<String> hostListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean, LinkedList<String> updateSqlList);

	public int dealNotFoundUnix(LinkedList<String> unixhostListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean, LinkedList<String> updateSqlList);

	public int dealNotFoundProbe(LinkedList<String> probeListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean, LinkedList<String> updateSqlList);

	public int dealNotFoundPwDevice(LinkedList<String> pwDeviceListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean, LinkedList<String> updateSqlList);

	public int dealNotFoundfireWall(LinkedList<String> fireWallListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean, LinkedList<String> updateSqlList);

	public int dealNotFoundNode(LinkedList<String> nodeListInDB, boolean autoDelete, TaskInfo task, CommonBean commonBean, LinkedList<String> updateSqlList);

	public void dealNotFoundElement(LinkedList<String> updateSqlList);

	public void saveSwitchUpPort(String elementID, String portIndex);

	public void dealServerLink();

	public void saveIpAddr1(LinkedList<String> portInDB, String nodeID);

	public void saveIpAddr2(LinkedList<Object[]> saveData);

	public void saveIpAddr3(LinkedList<Object[]> saveData);

	public void saveIpAddr4(LinkedList<Object[]> saveData);

	public void saveIpAddr5(LinkedList<Object[]> saveData, String nodeID);

	public void savePort1(LinkedList<String> portInDB, LinkedList<String> portInDBl, String nodeID);

	public void savePort2(LinkedList<Object[]> saveData);

	public void savePort3(LinkedList<Object[]> saveData, String nodeID);

	public void savePort4(LinkedList<Object[]> saveData1);

	public void savePort5(LinkedList<Object[]> saveData1, String nodeID);

	public void savePort6(LinkedList<Object[]> saveData2);

	public void savePort7(LinkedList<Object[]> saveData2, String nodeID);

	public void saveSubNet(LinkedList<Object[]> saveData, LinkedList<Object[]> saveData1);
	
	public ArrayList<LinkObj> getAllLink();
	
	public Map<String,IpMacTable> findAllIpMac();
	
	public void saveDeviceLink(Object[] saveData);
	
	public void saveDeviceMac(Object[] rowData);
	public void deleteDeviceMac();
	
	public List<String> findAllIpByMac(String srcmac);
	
	public ArrayList<NodeObj> getAllNodeObj();		
	
	public ArrayList<TopoTask> getAllTask();
	
	public void updateTopoTask(String id, int status);
}
